/*
 * PlayerEntry.java
 *
 * Created on 8 de Agosto de 2007, 16:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.gpp.proj1.ui.gui.lobby;

/**
 *
 * @author Gustavo
 */
public class PlayerEntry {
    
    private String name;
    private int id;
    private boolean ready;
            
    /** Creates a new instance of PlayerEntry */
    public PlayerEntry( int id, String name, boolean ready ) {
        this.id = id;
        this.name = name;
        this.ready = ready;
    }

    public String getName() {
        return name;
    }

    public int getId() {
        return id;
    }
    
    public boolean isReady() {
        return this.ready;
    }
    
    public void changeState() {
        this.ready = !this.ready;
    }
    
    public boolean equals( Object obj ) {
        return ((PlayerEntry)obj).getId() == this.getId();
    }
}
